package org.apache.flink.connector.scylladb.config;

/**
 * ScyllaDB 连接器常量定义
 */
public class ScyllaDBConnectorConstants {

    // 连接器标识符
    public static final String IDENTIFIER = "scylladb";

    // 默认配置值
    public static final String DEFAULT_USERNAME = "cassandra";
    public static final String DEFAULT_PASSWORD = "cassandra";
    public static final int DEFAULT_FETCH_SIZE = 1000;
    public static final int DEFAULT_PARALLELISM = 1;
    public static final long DEFAULT_CACHE_MAX_ROWS = 10000L;
    public static final int DEFAULT_MAX_RETRIES = 3;
    public static final int DEFAULT_BUFFER_FLUSH_MAX_ROWS = 100;
    public static final int DEFAULT_CONNECTION_POOL_SIZE = 1;

    // 超时时间（毫秒）
    public static final long DEFAULT_CONNECTION_TIMEOUT_MS = 5000L;
    public static final long DEFAULT_REQUEST_TIMEOUT_MS = 12000L;
    public static final long DEFAULT_CACHE_TTL_MS = 600000L;
    public static final long DEFAULT_BUFFER_FLUSH_INTERVAL_MS = 1000L;

    // 一致性级别
    public static final String DEFAULT_CONSISTENCY_LEVEL = "QUORUM";

    // 支持的数据类型映射
    public static final String CQL_TYPE_TEXT = "text";
    public static final String CQL_TYPE_VARCHAR = "varchar";
    public static final String CQL_TYPE_INT = "int";
    public static final String CQL_TYPE_BIGINT = "bigint";
    public static final String CQL_TYPE_FLOAT = "float";
    public static final String CQL_TYPE_DOUBLE = "double";
    public static final String CQL_TYPE_BOOLEAN = "boolean";
    public static final String CQL_TYPE_TIMESTAMP = "timestamp";
    public static final String CQL_TYPE_UUID = "uuid";
    public static final String CQL_TYPE_TIMEUUID = "timeuuid";
    public static final String CQL_TYPE_DECIMAL = "decimal";
    public static final String CQL_TYPE_BLOB = "blob";

    // 错误消息
    public static final String ERROR_MISSING_URL = "Missing required option 'url'";
    public static final String ERROR_MISSING_KEYSPACE = "Missing required option 'key-space'";
    public static final String ERROR_MISSING_TABLE_NAME = "Missing required option 'table-name'";
    public static final String ERROR_INVALID_CONSISTENCY_LEVEL = "Invalid consistency level";
    public static final String ERROR_CONNECTION_FAILED = "Failed to connect to ScyllaDB";
    public static final String ERROR_KEYSPACE_NOT_EXISTS = "Keyspace does not exist";
    public static final String ERROR_TABLE_NOT_EXISTS = "Table does not exist";

    // CQL 查询模板
    public static final String SELECT_QUERY_TEMPLATE = "SELECT %s FROM %s.%s";
    public static final String SELECT_WHERE_TEMPLATE = "SELECT %s FROM %s.%s WHERE %s";
    public static final String INSERT_QUERY_TEMPLATE = "INSERT INTO %s.%s (%s) VALUES (%s)";
    public static final String UPDATE_QUERY_TEMPLATE = "UPDATE %s.%s SET %s WHERE %s";
    public static final String DELETE_QUERY_TEMPLATE = "DELETE FROM %s.%s WHERE %s";

    // 系统表查询
    public static final String DESCRIBE_KEYSPACE_QUERY = "SELECT * FROM system_schema.keyspaces WHERE keyspace_name = ?";
    public static final String DESCRIBE_TABLE_QUERY = "SELECT * FROM system_schema.tables WHERE keyspace_name = ? AND table_name = ?";
    public static final String DESCRIBE_COLUMNS_QUERY = "SELECT * FROM system_schema.columns WHERE keyspace_name = ? AND table_name = ?";

    // 私有构造函数，防止实例化
    private ScyllaDBConnectorConstants() {
        // 工具类，不允许实例化
    }
} 